<template>
  <work-template v-loading="loading" v-model="ruleForm"
                 @closeSelectedTag="closeSelectedTag" :butShow="false">
    <div slot="form" class="container-div">
      <!--处置结果  合同信息 处置付款信息  违约信息 收款进度 付款进度-->
      <disposalResultMessage v-model="ruleForm" state="readonly" @reset="reset"/>
    </div>
  </work-template>
</template>

<script>
import * as apis from '@/api/vehicleDisposal/routineHandle.js'
import {getDisposalResult} from "@/api/vehicleDisposal/routineHandle.js";

export default {
  name: 'DisposalResultDetails',
  components: {
    disposalResultMessage: () => import('../../components/routineDisposal/routineHandle/disposalResultMessage.vue')
  },
//处置结果详情
  computed: {},
  watch: {},
  data() {
    return {
      ruleForm: {},
      loading: false
    };
  },
  created() {
    if (this.$route.query.id) {
      this.handleDetails()
    }
  },
  mounted() {
  },
  methods: {
    async handleDetails() {
      this.loading = true
      try {
        const res = await getDisposalResult(this.$route.query.id)
        this.ruleForm = res.data
      } catch (e) {
        console.error(e)
      } finally {
        this.loading = false
      }
    },

    reset() {
      this.handleDetails()
    },

    closeSelectedTag(view) {
      this.$tab.closePage(view).then(({visitedViews}) => {
        this.$router.push({
          path: "/VehicleDisposal/RoutineDisposal/RoutineHandleDetails",
          query: {
            id: this.$route.query.id,
            type: 'view',
            path: 'RoutineHandleList'
          }
        });
      });
    },
  },
};
</script>

<style scoped lang=""></style>


